package Year2021.month10.Day21.Day27;

import java.util.Scanner;

public class LeasingCompanyTest {
    public static void main(String[] args) {
        LeasingCompany l=new LeasingCompany();
        l.setName("美好中国租赁有限公司");
        l.setPhone("999999999");
        l.setNumberOfCars(8);
        l.show();
        System.out.println();
        Scanner in=new Scanner(System.in);
        while (true){
            System.out.println("现在的选择是？1:查看车辆情况,2:租赁车辆,3:还车,4:报废,5:采购新车,6:查看租赁记录,9:退出！");
            int choice=in.nextInt();
            if (choice==1){
                l.display();
            }
            else if (choice==2){
                l.rent();

            }else if (choice==3){
                System.out.println("请输入你要还的车的车牌号！");
                String k=in.next();
//                l.returnTheCar(k);
                boolean s=l.returnTheCar(k);
                System.out.println(s?"还车成功!":"还车失败！");

            }else if (choice==4){
                System.out.println("请输入你要报废的车牌号！");
                String k1=in.next();
                boolean s1=l.scrap(k1);
                //boolean s1=l.scrap(k1);
                System.out.println(s1?"报废成功！":"报废失败！");

            }
            else if (choice==5){
               Automobile automobile=new Car("奥迪","京A123456",1000,
                       "当前可租","A4L");
               l.buy(automobile);
            }
            else if (choice==9){
                System.out.println("退出！");
            }
        }














    }
}
